package com.sjp.demo.rpc.client;

import com.sjp.demo.rpc.api.HelloService;
import com.sjp.demo.rpc.model.User;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * Hello world!
 */
public class App {
    public static void main(String[] args) {

        ApplicationContext context = new AnnotationConfigApplicationContext(SpringConfig.class);

        RpcProxyClient client = context.getBean(RpcProxyClient.class);
        HelloService helloService = client.getService(HelloService.class);

        String result = helloService.sayHello("sjp");
        System.out.println(result);

        User user = new User();
        helloService.saveUser(user);
    }
}
